#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdbool.h>
bool isPerfectSquare(int num) {
	int left = 0;
	int right = num;
	while (left <= right)
	{
		long long  mid = left + (right - left) / 2;
		long long  tmp = mid * mid;
		if (tmp == num)
		{
			return true;
		}
		else if (tmp < num)
		{
			left = mid + 1;
		}
		else
		{
			right = mid - 1;
		}

	}
	return false;
}
int main()
{
	printf("%d", isPerfectSquare(1));
	printf("%d", isPerfectSquare(4));
	printf("%d", isPerfectSquare(9));
	printf("%d", isPerfectSquare(16));
	printf("%d", isPerfectSquare(24));
	printf("%d", isPerfectSquare(68));
	printf("%d", isPerfectSquare(144));
	return 0;
}